<!doctype html>
<html lang="en">
<head>
    @include('web.layout.head')
    <link rel="stylesheet" href="{{asset('/css/web/user/safe.css')}}">
</head>
<body>
@include('web.layout.header')
@include('web.layout.user_tab')
<div class="base_member_content">
    <div class="w1200">
        @include('web.layout.member_nav')
        @if (count($errors) > 0)

           <div class="alert alert-danger">
               @foreach ($errors->all() as $error)
                   <input type="hidden" id="error_msg" value="{{ $error }}">
               @endforeach
           </div>
       @endif
        <div class="nav_right flr">
            <div class="base_content">
                <div class="line_title">账号安全</div>
                <div class="levelbox">
                    <div class="word1 fl">安全等级</div>
                    <div class="level fl">
                        <?php
                        $level = 0;
                        if(array_get($data,'email')) $level += 0.5;
                        if(array_get($data,'pay_pwd')) $level += 0.5;
                        ?>
                        <input type="hidden" id="level" name="" value="{{$level}}">
                        <span></span>
                    </div>
                    <div class="level_word fl">较低</div>
                    <div class="word2 fl">建议您启动全部安全设置，以保障账户及资金安全</div>
                </div>
                <div class="optionbox">
                    <div class="option">
                        <div class="options">
                            <div class="iconbox fl"><img src="{{asset('/img/web/inc/icon/true.png')}}" alt="" /></div>
                            <div class="opname fl">登录密码</div>
                            <div class="opcon fl">互联网账号存在被盗风险，建议您定期更改密码以保护账户安全。</div>
                            <a href="{{asset('/member/user/pwd_revise')}}" class="jm_btn1 btn flr">修改</a>
                        </div>
                    </div>
                    <div class="option">
                        <div class="options">
                            <div class="iconbox fl"><img src="{{asset('/img/web/inc/icon/true.png')}}" alt="" /></div>
                            <div class="opname fl">手机验证</div>
                            <div class="opcon fl">您验证的手机： <span class="tel">{{substr_replace(array_get($data,'phone'), '****', 3, 4)}}</span> 若已丢失或停用，请立即更换，<span style="color: #f20909;">避免账户被盗</span>。</div>
                            <a href="{{asset('/member/user/phone_revise')}}" class="jm_btn1 btn flr">修改</a>
                        </div>
                    </div>
                    <div class="option">
                        <div class="options">
                            @if(!empty(array_get($data,'email')))
                            <div class="iconbox fl"><img src="{{asset('/img/web/inc/icon/true.png')}}" alt="" /></div>
                            <div class="opname fl">邮箱验证</div>
                            <div class="opcon fl">您验证的邮箱：<span class="mail">{{array_get($data,'email')}}</span> 若已丢失或停用，请立即更换，避免账户被盗。</div>
                            <a href="{{asset('/member/user/email_revise')}}" class="jm_btn1 btn flr">修改</a>
                            @else
                            <div class="iconbox fl"><img src="{{asset('/img/web/inc/icon/warning.png')}}" alt="" /></div>
                            <div class="opname fl">邮箱验证</div>
                            <div class="opcon fl">您还没验证邮箱，绑定邮箱可用于快速找回密码。</div>
                            <a href="{{asset('/member/user/email_revise')}}" class="jm_btn4 btn flr">设置</a>
                            @endif
                        </div>
                    </div>
                    <div class="option">
                        <div class="options">
                            @if(!empty(array_get($data,'pay_pwd')))
                            <div class="iconbox fl"><img src="{{asset('/img/web/inc/icon/true.png')}}" alt="" /></div>
                            <div class="opname fl">支付密码</div>
                            <div class="opcon fl">使用账户余额购买商品时用支付密码支付。</div>
                            <a href="{{asset('/member/user/pay_revise')}}" class="jm_btn1 btn flr">修改</a>
                            @else
                            <div class="iconbox fl"><img src="{{asset('/img/web/inc/icon/warning.png')}}" alt="" /></div>
                            <div class="opname fl">支付密码</div>
                            <div class="opcon fl">使用账户余额购买商品时用支付密码支付。</div>
                            <a href="{{asset('/member/user/pay_revise')}}" class="jm_btn4 btn flr">设置</a>
                            @endif
                        </div>
                    </div>
                </div>
            </div>
            <div class="prompt">
                <div class="tit">安全服务提示</div>
                <div class="con">
                    <p>1.确认您登录的是e井在线网址 http://www.ejing365.com ，注意防范进入钓鱼网站，不要轻信各种即时通讯工具发送的商品或支付链接，谨防网购诈骗。</p>
                    <p>2.建议您安装杀毒软件，并定期更新操作系统等软件补丁，确保账户及交易安全。</p>
                </div>
            </div>
        </div>
    </div>
</div>
@include('web.layout.footer')
<script>
$(function () {
    var level = $('#level').val();
    $('.level span').css("width",level*100+'%');
    if(level == 0){
        $('.level_word').html('较低');
        $('.level_word').css({"color":"red"})
    }else if(level ==0.5 ){
        $('.level_word').html('中等');
    }else if(level == 1 ){
        $('.level_word').html('完善');
        $('.level_word').css({"color":"#71b247"})
    }

    var error_msg=$('#error_msg').val();
    if(error_msg){
        layer.alert(error_msg, {
            icon: 1
        });
    }
})
</script>
</body>
</html>